<?php

$inc_lib = realpath(dirname(__FILE__) . '/../teia.lib/inc/inc_core.inc');
require_once $inc_lib;
use teia\webdev\php\core as teia;

$inc_cust = realpath(dirname(__FILE__) . '/../teia.cust/inc/inc_cust.inc');
require_once $inc_cust;
use teia\webdev\php\cust as cust;

$result = teia\SessionWrapper::start();
if (!$result) {
	echo "Session Error: Failed to start session\n";
}
$err_msg = isset($_REQUEST['err_msg']) ? $_REQUEST['err_msg'] : '';

try {
	$filter = array('prod_gender' => 'F');
	if (isset($_REQUEST['prod_type']) && is_string($_REQUEST['prod_type'])) {
		$filter['prod_type'] = $_REQUEST['prod_type'];;
	}
	// fetch products from database
	$product_listing = new teia\ProductCatalog('_product_catalog_f_', 'ProductCatalog', null, $filter);
	$paginator = new teia\PaginationProvider('_pagination_', 'Pagination', null, $product_listing);
} catch (InvalidArgumentException $e) {
	$err_msg = $e->getMessage() . ' [' . $e->getCode() . ']';
} catch (Exception $e) {
	$err_msg = $e->getMessage() . ' [' . $e->getCode() . ']';
}
?>

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>Shoes Boutique: Contacto</title>
		<link href="/style/layout.css" rel="stylesheet" type="text/css">
		<link href="/style/style01.css" rel="stylesheet" type="text/css">
		<link href="/style/style_slideshow.css" rel="stylesheet" type="text/css">
		<link href="/style/catalog.css" rel="stylesheet" type="text/css">
		<?php teia\FunctionPool::include_jquery(); ?>
		<style type="text/css">
			.auto-style1 {
				margin-left: 0;
			}
		</style>
	</head>
	<body>
		<div align="center" style="position: absolute; margin-left: inherit; margin-right: inherit">
			<!-- Display header logo -->
			<?php cust\CustFunctions::display_header_logo(); ?>
			<!-- Display top navigation -->
			<?php cust\CustFunctions::display_top_nav(); ?>
			<!-- Display error message, if any -->
			<?php cust\CustFunctions::display_err_msg($err_msg); ?>
			<!-- Display menu -->	
			<?php cust\CustFunctions::display_menu(); ?>
			<!-- Display ad-banner-->
			<?php cust\CustFunctions::display_top_banner(); ?>
			<!-- Display gender sub-menu-->
			<?php cust\CustFunctions::display_gender_submenu(); ?>
			<div id="left_nav_bar" >
				<h3 class="category_menu">Marcas</h3>
    			<div class="drop_menu">
    				<!--  the content goes here  -->     	
    			</div>
    			<h3 class="category_menu">Estilos</h3>
    			<div class="drop_menu">
    				<!--  the content goes here  -->     	
    			</div>	
    			<h3 class="category_menu">Tamanhos</h3>
    			<div class="drop_menu">
    				<!--  the content goes here  -->     	
    			</div>
    			<h3 class="category_menu">Preços</h3>
    			<div class="drop_menu">
    				<!--  the content goes here  -->     	
    			</div> 
    			<h3 class="category_menu">Cores</h3>
    			<div class="drop_menu">
    				<!--  the content goes here  -->     	
    			</div> 
			</div>
			<div id="container">  
    			<?php @$paginator->display('page'); ?>
			</div>
			<div id="right_nav_bar">
			
			</div>
			<?php cust\CustFunctions::display_footer(); ?>
		</div>
	</body>
</html>
